using UnityEngine;
using System.Collections;

public class _BgSpecial : MonoBehaviour {

	public Texture textura;
	public static bool stop = false;
	
	public void Start()
	{
		gameObject.AddComponent("MeshRenderer");
		gameObject.AddComponent("MeshFilter");
				
		Mesh mesh = Quad.Create(80 , 20);
		gameObject.GetComponent<MeshFilter>().mesh = mesh;
		gameObject.GetComponent<MeshRenderer>().material = (Material) Resources.Load("Outros/Material");
		gameObject.GetComponent<MeshRenderer>().material.mainTexture = textura;
	}
	
	public void Update()
	{
		if(this.gameObject.transform.position.x > -20)
		{
			transform.Translate(_Speed.speed , 0 , 0);
		}
		
		else
		{
			stop = true;
		}
		
	}	
}
